/**
 * useRef(保存引用值)
 */
 import React, { useState, useRef } from 'react';
 
 export default function MyRefs() {
    const [count, setcount] = useState(0)
    var mycount=useRef(0)
    return (
        <div>
            <button onClick={() =>{
                setcount(count+1)
                mycount.current+=1
                }}>+</button>
                {count}-{mycount.current}
        </div>
    );
 }